package org.shiwen.week3.answer;

import java.util.Scanner;

public class BMI {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入你的身高:（单位：m） ");
        double height = input.nextDouble();
        System.out.print("请输入你的体重:（单位：kg） ");
        double weight = input.nextDouble();
        double bmi = weight / (height * height);
        System.out.print("你的BMI值为: "+bmi);
        if (bmi < 18.5) {
            System.out.println("偏瘦");
        }else if (bmi >= 18.5 && bmi <= 24) {
            System.out.println("正常");
        }else if (bmi > 24 && bmi < 28) {
            System.out.println("偏胖");
        }else{
            System.out.println("超重");
        }
    }
}
